package test.circleimport;

import java.math.BigDecimal;

public class Bill {
    private Customer customer;
    private BigDecimal price;

    public Bill(Customer customer, BigDecimal price) {
        this.customer = customer;
        this.price = price;
    }

    public BigDecimal pay() {
        BigDecimal discount = new BigDecimal(1)
                .subtract(this.customer.getDiscountAmount())
                .setScale(2, BigDecimal.ROUND_HALF_UP);
        return new BigDecimal(price.floatValue() * discount.floatValue());
    }

}
